package com.nand.module.user.utils;

import android.content.Context;

import com.alibaba.fastjson.JSON;
import com.nand.library.base.utils.SharedPreferencesUtils;
import com.nand.module.user.bean.UserInfoBean;

/**
 * Created by 孝杰 on 2019/12/16.
 */
public class UserUtils {

    /**
     * 获取用户信息
     * @return
     */
    public static UserInfoBean getUserInfo(Context context){
        String userInfo = (String) SharedPreferencesUtils.getParam(context, "userInfo", "");
        if (userInfo!=null) {
            UserInfoBean userInfoBean = JSON.parseObject(userInfo, UserInfoBean.class);
            return userInfoBean;
        }
     return null;
    }
}
